#include<bits/stdc++.h>

using namespace std;
#define endl '\n'

/**
 * 大数阶乘
 * @return
 */
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    vector<int> a = {1};
    for (int i = 2; i <= 1977; i++) {
        for (int j = 0; j < a.size(); j++) {
            a[j] *= i;
        }
        int carry = 0;
        for (int j = 0; j < a.size(); j++) {
            a[j] += carry;
            carry = a[j] / 10;
            a[j] %= 10;
        }
        while (carry > 0) {
            a.push_back(carry % 10);
            carry /= 10;
        }
    }
    for (int i = a.size() - 1; i >= 0; i--) {
        cout << a[i];
    }


    return 0;
}